Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve pipeline stages ast errors. #2805

Merged
merged 1 commit into from
Oct 26, 2020

Conversation

cyriltovena
Copy link
Contributor

They would throw 500 instead of 4xx before.

/cc thanks @owen-d for finding it.

Signed-off-by: Cyril Tovena cyril.tovena@gmail.com

They would throw 500 instead of 4xx before.

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>

// IsParseError returns true if the err is a ast parsing error.
func IsParseError(err error) bool {
_, ok := err.(ParseError)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could use new errors.Is api :)
https://golang.org/pkg/errors/#Is
Two advantages:

  1. avoid type assertion
  2. can also be wrapped errors!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitively a good idea. I would prefer to keep this for another PR I'm chasing after a bug for 2.0.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course :) np!

Copy link
Contributor

@sandeepsukhani sandeepsukhani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@kavirajk kavirajk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@cyriltovena cyriltovena merged commit ecc4022 into grafana:master Oct 26, 2020
@cyriltovena cyriltovena added this to the 2.2 milestone Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants